package main

import (
	"fmt"
	"golang/gofire"
)

type Student struct {
	Name string `form:"name"`
	Age  int    `form:"age"`
}

func main() {
	server := gofire.New(":9011")
	server.Get("/index", func(c *gofire.Context) error {
		stu := Student{}
		c.ShouldBindQuery(&stu)
		fmt.Println(stu)
		c.Json(200, "hello world")
		return nil
	})
	//group := server.NewGroup("/chat")
	//group.Get("bot", func(ctx *gofire.Context) error {
	//	ctx.Json(200, "chat bot")
	//	return nil
	//})
	//bot := group.NewGroup("bot")
	//bot.Get("/", func(ctx *gofire.Context) error {
	//	ctx.Json(200, "docs")
	//	return nil
	//})

	server.Run()
}
